package com.iscc.fake.domain;

import java.io.Serializable;
import java.util.List;

public class Pager implements Serializable {
    private int totalRecord;
    private int totalPage;
    private int currPage;
    private int PageNum;
    private int start;
    private int end;

    public Pager(int currPage, int pageNum, int totalRecord) {
        this.currPage = currPage;
        this.PageNum = pageNum;

        //总记录数
        this.totalRecord=totalRecord;
        //总记录数/每条查询的个数
        this.totalPage=this.totalRecord%this.PageNum==0 ? this.totalRecord/this.PageNum : (this.totalRecord/this.PageNum)+1;
        this.start=this.currPage<this.totalPage?(this.currPage-1)*this.PageNum :(this.totalPage-1)*this.PageNum;
        this.end=this.totalRecord%this.PageNum;



    }

    public int getTotalRecord() {
        return totalRecord;
    }

    public void setTotalRecord(int totalRecord) {
        this.totalRecord = totalRecord;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getCurrPage() {
        return currPage;
    }

    public void setCurrPage(int currPage) {
        this.currPage = currPage;
    }

    public int getPageNum() {
        return PageNum;
    }

    public void setPageNum(int pageNum) {
        PageNum = pageNum;
    }

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public int getEnd() {
        return end;
    }

    public void setEnd(int end) {
        this.end = end;
    }
}
